<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input type="button" value="开始计数" onclick="start()" >
		<input type="text" >
		<input type="button" value="停止计数" onclick="stop()">
		<script>
			var timer;
			var c=1;
			function myCount(){
				document.getElementById('count').value=c;
				c=c+1
			}
			function start(){
				setInterval(myCount,100);
			}
			function stop(){
				clearInterval(timer);
			}
			
		</script>
	</body>
</html>
